package io;

import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class OOSDemo {
    public static void main(String[] args) throws IOException {
        Student zs = new Student("秀明",18,"女",new String[]{"喜欢男装","舞蹈"});

        FileOutputStream fos = new FileOutputStream("zs.obj");
        BufferedOutputStream bos = new BufferedOutputStream(fos);
        ObjectOutputStream oos = new ObjectOutputStream(bos);
        oos.writeObject(zs);
        System.out.println("写完了");
        System.out.println(zs);
        oos.close();

    }
}
